package com.twu.biblioteca;

import com.twu.biblioteca.controller.UserController;
import com.twu.biblioteca.models.Library;
import com.twu.biblioteca.view.BibliotecaUI;


import java.util.Scanner;

public class BibliotecaApp {

    public static void main(String[] args) throws Exception {
        UserInitializer userInitializer = new UserInitializer();
        Library library = LibraryInitializer.createSampleLibrary();
        UserController userController = userInitializer.createSampleUserController();
        BibliotecaUI bibliotecaUI = new BibliotecaUI(library, userController);
        bibliotecaUI.displayWelcomeMessage();
        Scanner in = new Scanner(System.in);
        while (true)
        {
            bibliotecaUI.displayMainMenu();
            int choice = in.nextInt();
            bibliotecaUI.selectMenuItem(choice);
        }
    }

}
